FROM openjdk:8-jre-alpine

LABEL maintainer="buwei <bu_wei@qq.com>"

# 设置时区为上海
#RUN apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
#    && echo "Asia/Shanghai" > /etc/timezone \
#    && apk del tzdata

RUN echo "Asia/Shanghai" > /etc/timezone

ENV APPLICATION provider-service-by-rocketmq
ENV BASE_PATH /opt/provider-service-by-rocketmq
ENV CONFIG_DIR /opt/provider-service-by-rocketmq/config/

ENV VM_OPTS -server -Xms200m -Xmx200m -Xmn100m -Xss256k 
ENV SPB_OPTS --spring.config.location=${CONFIG_DIR} --my.logging.filename=${APPLICATION} --my.logging.path=/root/logs/ -Djava.security.egd=file:/dev/./urandom

WORKDIR /opt/

ENTRYPOINT exec java ${VM_OPTS} -jar ${BASE_PATH}/boot/${APPLICATION}.jar ${SPB_OPTS}